<?php

class TLoader_Instance{
    private static $loader = Array();
    public static function get($filepath){
        if(file_exists($filepath)){
            if(is_file($filepath)){
                if(!isset(self::$loader['fileloader'])){
                    self::$loader['fileloader'] = new TLoader_File();
                }
                return self::$loader['fileloader'];
            }else if(is_dir($filepath)){
                if(!isset(self::$loader['dirloader'])){
                    self::$loader['dirloader'] = new TLoader_Dir();
                }
                return self::$loader['dirloader'];
            }
            return null;
        }
        echo "$filepath\n";
        return null;
    }
}

?>
